<HTML><HEAD><TITLE>record_create(-Handle)</TITLE>
</HEAD><BODY>[ <A HREF="index.html">Recorded Database</A> | <A HREF="../../index.html">Reference Manual</A> | <A HREF="../../fullindex.html">Alphabetic Index</A> ]
<H1>record_create(-Handle)</H1>
Create an anonymous record handle
<DL>
<DT><EM>Handle</EM></DT>
<DD>Variable, will be bound to a handle.
</DD>
</DL>
<H2>Description</H2>

    	This creates an anonymous 'record' object which can store an
	ordered list of terms, and whose contents are unaffected by
	backtracking.
<P>
	Records can be referred to either by handle or by name. Whenever
	possible, handles should be used, because this naturally leads to
	robust, reentrant code, and avoids the danger of memory leaks.
	An anonymous record disappears when the system backtracks over
	its creation, when the record handle gets garbage collected,
	or when it is explicitly destroyed.
<P>
	When named records are used, the visibility of the record name is
	local to the module where it was created. A named record never
	disappears, therefore, in order to free the associated memory,
	its contents should be erased when no longer needed.
    
<H3>Modes and Determinism</H3><UL>
<LI>record_create(-) is det
</UL>
<H2>Examples</H2>
<PRE>
	?- record_create(R), record(R,a), record(R,b), recorded_list(R,L).
	L = [a,b]

	?- record_create(R),
	   ( member(X,[a,b,c]), record(R,X), fail
	   ; recorded_list(R,L)
	   ).
	L = [a,b,c]
</PRE>
<H2>See Also</H2>
<A HREF="../../kernel/record/is_record-1.html">is_record / 1</A>, <A HREF="../../kernel/modules/local-1.html">record / 1</A>, <A HREF="../../kernel/record/record-2.html">record / 2</A>, <A HREF="../../kernel/record/recorded-2.html">recorded / 2</A>
</BODY></HTML>
